<template>
  <div class="achiev-container mindWidth">
    <div class="lable-name">科技成果</div>
    <div class="flex items-middle space-between">
      <div class="list-content">
        <a
          class="list-item flex items-middle space-between"
          v-for="(item,index) in achieveList"
          :key="item.id"
          :href="`./achievDetail/${item.id}`"
          target="_blank"
        >
          <div class="name">{{item.achievementsName}}</div>
          <div class="time">{{item.createTime}}</div>
        </a>
        <a target="_blank" :href="`./achievList`" class="more list-item">查看更多</a>
      </div>
      <div class="list-content">
        <a
          class="list-item flex items-middle space-between"
          v-for="(v,j) in demandList"
          :key="v.id"
          :href="`./demandDetail/${v.id}`"
          target="_blank"
        >
          <div class="name">{{v.name}}</div>
          <div class="time">{{v.createTime}}</div>
        </a>
        <a target="_blank" :href="`./demandList`" class="more list-item">查看更多</a>
      </div>
    </div>
  </div>
</template>
<script>
// import { achievementsList, demandList } from "../api/api.js";
export default {
  props: {
    achieveList: {
      type: Array,
      default: []
    },
    demandList: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
      // achievementsList: [],
      // demandList: []
    };
  },
  mounted() {
    // this.getAchievementsList();
    // this.getDemandList();
  },
  methods: {
    // // 科技成果
    // getAchievementsList() {
    //   achievementsList({ pageSize: 5, pageNo: 1 }).then(res => {
    //     this.achievementsList = res.result.records;
    //   });
    // },
    // // 科技成果需求
    // getDemandList() {
    //   demandList({ pageSize: 5, pageNo: 1 }).then(res => {
    //     this.demandList = res.result.records;
    //   });
    // },
    // toAchievDetail(item) {
    //   const { href } = this.$router.resolve({
    //     path: `/achievDetail/${item.id}`
    //   });
    //   window.open(href, "_blank");
    // },
    // toAchievList() {
    //   const { href } = this.$router.resolve({
    //     path: `/achievList`
    //   });
    //   window.open(href, "_blank");
    // },
    // toDemandDetail(item) {
    //   const { href } = this.$router.resolve({
    //     path: `/demandDetail/${item.id}`
    //   });
    //   window.open(href, "_blank");
    // },
    // toDemandList() {
    //   const { href } = this.$router.resolve({
    //     path: `/demandList`
    //   });
    //   window.open(href, "_blank");
    // }
  }
};
</script>
<style lang="less" scoped>
.achiev-container {
  .lable-name {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    font-weight: 700;
  }
  .list-content {
    width: 48%;
    padding: 10px 15px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 0 10px #ccc;
    border-radius: 10px;
    min-height: 265px;
    position: relative;
    .list-item {
      padding: 10px 0;
      box-sizing: border-box;
      color: #333;
      cursor: pointer;
      font-size: 14px;
      .name {
        width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    .more {
      color: #1678ff;
      text-align: right;
      box-sizing: border-box;
      position: absolute;
      bottom: 0;
      left: 45%;
    }
    .list-item:hover {
      color: #79bdff;
    }
  }
}
</style>